package com.recruit.wechat.controller;


import com.recruit.wechat.controller.model.ApiResultModel;
import org.springframework.web.bind.annotation.RequestMapping;
import com.recruit.wechat.bean.result.ResultPage;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ResponseBody;

import com.recruit.wechat.bean.WechatResume;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 肖守凯
 * @since 2020-08-24
 */
@Controller
@RequestMapping("/WeChatUser/wechatResume")
public class WechatResumeController extends BaseController{
     /** 主页面 */
    @RequestMapping("admin/main.html")
    public String main(){
       return  "Wechatresume/WechatresumeMain";
    }
    /** 添加页面跳转
     * @return 返回页面
     */
    @RequestMapping(value = "admin/addWechatResumeHtml")
    public String addWechatResumeHtml( ){
             return "Wechatresume/WechatresumeAdd";
    }
    /** 编辑页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "admin/editWechatResumeHtml")
    public String editWechatResumeHtml(Integer id ,Model model ){
           model.addAttribute("wechatResume",wechatResumeService.selectWechatResumeByIdWechatResume(id));
             return "Wechatresume/WechatresumeEdit";
    }

    /** 查看页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "admin/showWechatResumeHtml")
    public String showWechatResumeHtml(Integer id ,Model model ){
           model.addAttribute("wechatResume",wechatResumeService.selectWechatResumeByIdWechatResume(id));
             return "Wechatresume/WechatresumeShow";
    }


    /** 分页查询WechatResume
     * @param page  页码
     * @param limit  查几条
     * @param wechatResume  前端传进的参数
     * @return 返回统一分页信息
     */
    @RequestMapping(value = "admin/findWechatResumeByPage")
    @ResponseBody
    public ResultPage findWechatResumeByPage(Integer page, Integer limit,WechatResume wechatResume){
             return wechatResumeService.findWechatResumeByPage(page,limit,wechatResume);
    }

    /** 添加WechatResume
     * @param wechatResume  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "admin/addWechatResume")
    @ResponseBody
    public ApiResultModel saveWechatResume(WechatResume wechatResume  ){
             return wechatResumeService.addWechatResume(wechatResume);
    }

    /** 编辑WechatResume
     * @param wechatResume  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "admin/editWechatResume")
    @ResponseBody
    public ApiResultModel editWechatResume(WechatResume wechatResume  ){
             return wechatResumeService.editWechatResume(wechatResume);
    }



    /** 删除一条WechatResume
     * @param id  前端传进的ID
     * @return 返回统一信息
     */
    @RequestMapping(value = "admin/delWechatResume")
    @ResponseBody
    public ApiResultModel delWechatResume( Integer id  ){
             return wechatResumeService.delWechatResume(id);
    }


}
